package com.rybbaby.tss.platform.sysTableColumn.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * @description 数据库表映射
 *
 * @author 谢进伟
 *
 * @createDate 2016年2月22日 上午11:23:56
 */
@Entity
@Table(name = "sys_table_column_mapping")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
@SuppressWarnings("serial")
public class SysTableColumnMapping implements Serializable {

	/** 主键 **/
	private String id;
	/** 方案 **/
	private String scheme;
	/** 表名 **/
	private String tableName;
	/** 列名 **/
	private String columnName;
	/** 映射名 **/
	private String columnJavaFieldName;
	/** Java类型 **/
	private String columnJavaType;
	/** 数据库类型名称 **/
	private String columnTypeName;
	/** 最大字符数 **/
	private Integer columnDisplaySize;
	/**
	 * 获取指定列的指定列的大小。对于数值型数据,这是最大的精度。对于字符数据,这是长度的字符。datetime数据类型,这是长度的字符的字符串表示(
	 * 假设的最大允许精确分数秒组件)。对于二进制数据,这是长度的字节。对于ROWID数据类型,这是长度的字节。0返回数据类型的列的大小,不适用。
	 **/
	private Integer columnPrecision;
	/** 小数点右边的有效数字字符数 **/
	private Integer columnScale;
	/** 状态 **/
	private Integer status;
	/** 是否自增 **/
	private Boolean isAutoIncrement;
	/** 是否区分大小写 **/
	private Boolean isCaseSensitive;
	/** 是否可作为条件 **/
	private Boolean isSearchable;
	/** 是否可为空 **/
	private Boolean isNullable;
	/** 是否是主键 **/
	private Boolean isSigned;
	/** 是否是主键 **/
	private Boolean isPrimaryKey;
	/** 是否是外键 **/
	private Boolean isForeignKey;
	/** 引用的主表名称 **/
	private String referenceTable;
	/** 引用的主表列 **/
	private String referenceColumn;
	/** 版本 **/
	private Integer version;
	/** 列备注 **/
	private String remarks;
	/** 是否为创建时间 **/
	private Boolean isCreateTime;
	/** 是否为修改时间 **/
	private Boolean isModifiedTime;
	/** 新增时是否可编辑 **/
	private Boolean isAddCanEdit;
	/** 修改时是否可编辑 **/
	private Boolean isUpdateCanEdit;
	/** 是否是创建者标识 **/
	private Boolean isNowLoginUserIdentifying;
	/** 是否是版本标识 **/
	private Boolean isVersionIdentifying;
	/** 数据源名称 **/
	private String datasourceName;
	/** 数据源方案名 **/
	private String datasourceCatalog;
	/** 数据源表名 **/
	private String datasourceTableName;
	/** 数据源表 key 列 **/
	private String datasourceKeyColumn;
	/** 数据源表 value 列 **/
	private String datasourceValueColumn;
	/** 数据源Sql **/
	private String datasourceSql;
	/** 引用表显示列 **/
	private String referenceTableShowColumns;
	/** 引用表可作检索条件列 **/
	private String referenceTableSearchColumns;

	/** 属性参数json串 **/
	private String attrsJsonStr;
	/**上传组件配置参数**/
	private String uploadConfig;

	@Id
	@GeneratedValue(generator = "paymentableGenerator" , strategy = GenerationType.AUTO)
	@GenericGenerator(name = "paymentableGenerator" , strategy = "uuid")
	@Column(name = "ID" , nullable = false , length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "SCHEME" , length = 255 , nullable = true)
	public String getScheme() {
		return scheme;
	}

	public void setScheme(String scheme) {
		this.scheme = scheme;
	}

	@Column(name = "TABLENAME" , length = 255 , nullable = true , columnDefinition = "")
	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	@Column(name = "COLUMNNAME" , length = 255 , nullable = true)
	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	@Column(name = "COLUMNJAVAFIELDNAME" , length = 255 , nullable = true)
	public String getColumnJavaFieldName() {
		return columnJavaFieldName;
	}

	public void setColumnJavaFieldName(String columnJavaFieldName) {
		this.columnJavaFieldName = columnJavaFieldName;
	}

	@Column(name = "COLUMNJAVATYPE" , length = 255 , nullable = true)
	public String getColumnJavaType() {
		return columnJavaType;
	}

	public void setColumnJavaType(String columnJavaType) {
		this.columnJavaType = columnJavaType;
	}

	@Column(name = "COLUMNTYPENAME" , length = 255 , nullable = true)
	public String getColumnTypeName() {
		return columnTypeName;
	}

	public void setColumnTypeName(String columnTypeName) {
		this.columnTypeName = columnTypeName;
	}

	@Column(name = "COLUMNDISPLAYSIZE" , precision = 11 , scale = 0 , nullable = true)
	public Integer getColumnDisplaySize() {
		return columnDisplaySize;
	}

	public void setColumnDisplaySize(Integer columnDisplaySize) {
		this.columnDisplaySize = columnDisplaySize;
	}

	@Column(name = "COLUMNPRECISION" , precision = 11 , scale = 0 , nullable = true)
	public Integer getColumnPrecision() {
		return columnPrecision;
	}

	public void setColumnPrecision(Integer columnPrecision) {
		this.columnPrecision = columnPrecision;
	}

	@Column(name = "COLUMNSCALE" , precision = 11 , scale = 0 , nullable = true)
	public Integer getColumnScale() {
		return columnScale;
	}

	public void setColumnScale(Integer columnScale) {
		this.columnScale = columnScale;
	}

	@Column(name = "STATUS" , precision = 11 , scale = 0 , nullable = true)
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "ISAUTOINCREMENT" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsAutoIncrement() {
		return isAutoIncrement;
	}

	public void setIsAutoIncrement(Boolean isAutoIncrement) {
		this.isAutoIncrement = isAutoIncrement;
	}

	@Column(name = "ISCASESENSITIVE" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsCaseSensitive() {
		return isCaseSensitive;
	}

	public void setIsCaseSensitive(Boolean isCaseSensitive) {
		this.isCaseSensitive = isCaseSensitive;
	}

	@Column(name = "ISSEARCHABLE" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsSearchable() {
		return isSearchable;
	}

	public void setIsSearchable(Boolean isSearchable) {
		this.isSearchable = isSearchable;
	}

	@Column(name = "ISNULLABLE" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsNullable() {
		return isNullable;
	}

	public void setIsNullable(Boolean isNullable) {
		this.isNullable = isNullable;
	}

	@Column(name = "ISSIGNED" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsSigned() {
		return isSigned;
	}

	public void setIsSigned(Boolean isSigned) {
		this.isSigned = isSigned;
	}

	@Column(name = "ISPRIMARYKEY" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsPrimaryKey() {
		return isPrimaryKey;
	}

	public void setIsPrimaryKey(Boolean isPrimaryKey) {
		this.isPrimaryKey = isPrimaryKey;
	}

	@Column(name = "ISFOREIGNKEY" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsForeignKey() {
		return isForeignKey;
	}

	public void setIsForeignKey(Boolean isForeignKey) {
		this.isForeignKey = isForeignKey;
	}

	@Column(name = "REFERENCETABLE" , length = 255 , nullable = true)
	public String getReferenceTable() {
		return referenceTable;
	}

	public void setReferenceTable(String referenceTable) {
		this.referenceTable = referenceTable;
	}

	@Column(name = "REFERENCECOLUMN" , length = 255 , nullable = true)
	public String getReferenceColumn() {
		return referenceColumn;
	}

	public void setReferenceColumn(String referenceColumn) {
		this.referenceColumn = referenceColumn;
	}

	@Version
	@Column(name = "VERSION" , length = 11 , nullable = true)
	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "REMARKS" , length = 255 , nullable = true)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	@Column(name = "ISCREATETIME" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsCreateTime() {
		return isCreateTime;
	}

	public void setIsCreateTime(Boolean isCreateTime) {
		this.isCreateTime = isCreateTime;
	}

	@Column(name = "ISMODIFIEDTIME" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsModifiedTime() {
		return isModifiedTime;
	}

	public void setIsModifiedTime(Boolean isModifiedTime) {
		this.isModifiedTime = isModifiedTime;
	}

	@Column(name = "ISADDCANEDIT" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsAddCanEdit() {
		return isAddCanEdit;
	}

	public void setIsAddCanEdit(Boolean isAddCanEdit) {
		this.isAddCanEdit = isAddCanEdit;
	}

	@Column(name = "ISUPDATECANEDIT" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsUpdateCanEdit() {
		return isUpdateCanEdit;
	}

	public void setIsUpdateCanEdit(Boolean isUpdateCanEdit) {
		this.isUpdateCanEdit = isUpdateCanEdit;
	}

	@Column(name = "ISNOWLOGINUSERIDENTIFYING" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsNowLoginUserIdentifying() {
		return isNowLoginUserIdentifying;
	}

	public void setIsNowLoginUserIdentifying(Boolean isNowLoginUserIdentifying) {
		this.isNowLoginUserIdentifying = isNowLoginUserIdentifying;
	}

	@Column(name = "ISVERSIONIDENTIFYING" , precision = 1 , scale = 0 , nullable = true)
	public Boolean getIsVersionIdentifying() {
		return isVersionIdentifying;
	}

	public void setIsVersionIdentifying(Boolean isVersionIdentifying) {
		this.isVersionIdentifying = isVersionIdentifying;
	}

	@Column(name = "DATASOURCENAME" , length = 255 , nullable = true)
	public String getDatasourceName() {
		return datasourceName;
	}

	public void setDatasourceName(String datasourceName) {
		this.datasourceName = datasourceName;
	}

	@Column(name = "DATASOURCECATALOG" , length = 255 , nullable = true)
	public String getDatasourceCatalog() {
		return datasourceCatalog;
	}

	public void setDatasourceCatalog(String datasourceCatalog) {
		this.datasourceCatalog = datasourceCatalog;
	}

	@Column(name = "DATASOURCETABLENAME" , length = 255 , nullable = true)
	public String getDatasourceTableName() {
		return datasourceTableName;
	}

	public void setDatasourceTableName(String datasourceTableName) {
		this.datasourceTableName = datasourceTableName;
	}

	@Column(name = "DATASOURCEKEYCOLUMN" , length = 255 , nullable = true)
	public String getDatasourceKeyColumn() {
		return datasourceKeyColumn;
	}

	public void setDatasourceKeyColumn(String datasourceKeyColumn) {
		this.datasourceKeyColumn = datasourceKeyColumn;
	}

	@Column(name = "DATASOURCEVALUECOLUMN" , length = 255 , nullable = true)
	public String getDatasourceValueColumn() {
		return datasourceValueColumn;
	}

	public void setDatasourceValueColumn(String datasourceValueColumn) {
		this.datasourceValueColumn = datasourceValueColumn;
	}

	@Column(name = "DATASOURCESQL" , length = 255 , nullable = true)
	public String getDatasourceSql() {
		return datasourceSql;
	}

	public void setDatasourceSql(String datasourceSql) {
		this.datasourceSql = datasourceSql;
	}

	@Column(name = "REFERENCETABLESHOWCOLUMNS" , length = 255 , nullable = true)
	public String getReferenceTableShowColumns() {
		return referenceTableShowColumns;
	}

	public void setReferenceTableShowColumns(String referenceTableShowColumns) {
		this.referenceTableShowColumns = referenceTableShowColumns;
	}

	@Column(name = "REFERENCETABLESEARCHCOLUMNS" , length = 255 , nullable = true)
	public String getReferenceTableSearchColumns() {
		return referenceTableSearchColumns;
	}

	public void setReferenceTableSearchColumns(String referenceTableSearchColumns) {
		this.referenceTableSearchColumns = referenceTableSearchColumns;
	}

	@Column(name = "UPLOADCONFIG" , length = 2000 , nullable = true)
	public String getUploadConfig() {
		return uploadConfig;
	}

	public void setUploadConfig(String uploadConfig) {
		this.uploadConfig = uploadConfig;
	}

	@Transient
	public String getAttrsJsonStr() {
		return attrsJsonStr;
	}

	public void setAttrsJsonStr(String attrsJsonStr) {
		this.attrsJsonStr = attrsJsonStr;
	}
}
